package com.wbt.spi;

import java.util.Iterator;
import java.util.ServiceLoader;

public class SPITest {

    public static void main(String[] args) {
        ServiceLoader<SPIService> shouts = ServiceLoader.load(SPIService.class);
        Iterator<SPIService> iterator = shouts.iterator();
        try{
            while(iterator.hasNext()) {
                SPIService service = iterator.next();
                service.execute();
            }
        } catch(Throwable t) {
            // Do nothing
            t.printStackTrace();
        }
    }
}
